package com.hlcl.huaji.view;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;

import com.elcl.activity.BaseActivity;
import com.elcl.network.AppContext;
import com.elcl.util.StringUtils;
import com.elcl.util.viewutils.WebViewUtils;
import com.elcl.util.viewutils.WindowUtils;
import com.google.gson.reflect.TypeToken;
import com.hlcl.huaji.R;
import com.hlcl.huaji.model.Confing;
import com.hlcl.huaji.model.ConfingResult;

/**
 * Created by lichunlin on 2018/6/17.
 * 问题详情
 */

public class QuestionActivity extends BaseActivity {

    private Confing confing;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_quesiton);

        WindowUtils windowUtils = new WindowUtils();
        windowUtils.fullScreen(QuestionActivity.this);
        getConfing();

        WebView web_content = findViewById(R.id.web_content);
        WebViewUtils.loadDataWithHtml(web_content,confing.getQuestion());
    }

    private void getConfing() {
        String str_confing = AppContext.getConfing();
        if (StringUtils.isNotBlank(str_confing)) {
            ConfingResult confingResult = gson.fromJson(str_confing, new TypeToken<ConfingResult>() {
            }.getType());
            if (null != confingResult) {
                confing = confingResult.getjData();
            }
        }
    }

    @Override
    protected void praseJson(int reqId, String json) {

    }
}
